package cate.game.role.pvp.teampvp.msg;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTeamPvp;
import cate.game.pvp.teampvp.dto.TeamPvpPlayersData;

import java.util.Collections;

@ClientMsg(title = "组队竞技邀请列表请求")
public class TeamPvpInviteListReq implements MsgInput {
    @Override
    public void execute(GameBody game, ClientContext cc) {
        TeamPvpPlayersData data = game.pvp.teamPvp.inviteList(cc.getRole());
        cc.sendNow(new TeamPvpInviteListResp(data == null ? Collections.emptyList() : data.players));
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTeamPvp.INVITE_LIST_REQ;
    }
}
